﻿using System.Web;
using System.Web.SessionState;
using WaiShop.Model;

namespace WaiShop.Models
{
    public class AdminContext
    {
        /// <summary>
        /// 会话键
        /// </summary>
        private const string sessionKey = "ADMIN_SESSION_KEY";

        public HttpSessionState httpSession => HttpContext.Current.Session;

        public static AdminContext context = new AdminContext();

        /// <summary>
        /// 给用户赋值
        /// </summary>
        public UserInfo manager
        {
            get{
                return this.httpSession[sessionKey] as UserInfo;
            }
            set{
                this.httpSession[sessionKey] = value;
            }
        }
       





    }
}